package com.test.design_pattern.factory.abstract_fac;

/**
 * @author : zhangwei
 * @date : 2020-07-18
 **/
public class Main {
    public static void main(String[] args) {
        AbFactory factory = new ModernFactory();//如果要换工厂，只需要修改此处

        Food food = factory.createFood();
        food.printName();
        Vehicle vehicle = factory.createVehicle();
        vehicle.go();
        Weapon weapon = factory.createWeapon();
        weapon.shoot();

    }
}
